package com.dhcc.core.modules.system.warpper;

import java.util.Map;

import com.dhcc.core.config.properties.SysProperties;
import com.dhcc.core.framework.base.warpper.BaseControllerWarpper;
import com.dhcc.core.modules.system.cache.dict.DictCache;

/**
 * 字典列表的包装
 * 
 * @ClassName: DictWarpper
 * @Description: TODO
 * @author: cyf
 * @date: 2018年1月2日 上午10:43:21
 */
public class DictCategoryWarpper extends BaseControllerWarpper {

    public DictCategoryWarpper(Object list) {
        super(list);
    }

    @Override
    public void warpTheMap(Map<String, Object> map) {
        Long id = (Long) map.get("parentId");
        if(id==0){
            map.put("parentName", SysProperties.me().getOrgFullName());
        }else{
            map.put("parentName", DictCache.me().getCategoryNameById(id));
        }
    }

}
